//
//  ShippingAddressCell.m
//  LianShangBao
//
//  Created by 主事丫环HU on 2020/9/4.
//  Copyright © 2020 主事丫环. All rights reserved.
//

#import "ShippingAddressCell.h"
@interface ShippingAddressCell()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *isDefultLabel;
@property (weak, nonatomic) IBOutlet UITextView *addressTextView;

@end
@implementation ShippingAddressCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.addressTextView.userInteractionEnabled = NO;
}
+ (instancetype)cellWithTableView:(UITableView *)tableView {
    
    static NSString *ID = @"ShippingAddressCell";
    
    ShippingAddressCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        
        cell = [NSBundle.mainBundle loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (void)setModel:(ShippingAddressModel *)model {
    self.nameLabel.text = model.name;
    self.phoneLabel.text = model.phone;
    self.addressTextView.text = [NSString stringWithFormat:@"%@%@",model.areaName,model.address];
    if ([model.isDefault isEqualToString:@"0"]) {
        self.isDefultLabel.hidden = YES;
    } else {
        self.isDefultLabel.hidden = NO;
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
